package com.zc.study.thread.多线程第三章节.thread3_1_10;

import java.util.List;

public class Add extends Thread {
    private String lock;

    public Add(String lock) {
        this.lock = lock;
    }

    @Override
    public void run() {
       StoreArray ss = StoreArray.getInstance();
       List<Integer> list = ss.list;
        super.run();
        synchronized (lock){
           if(list.size() == 0){
               ss.add();
               lock.notifyAll();
           }
        }
    }
}
